import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { VisitorProgramDetailVO, VisitorProgramDetailForm, VisitorProgramDetailQuery } from '@/api/goods/visitorProgramDetail/types';

/**
 * 查询访客计划明细列表
 * @param query
 * @returns {*}
 */

export const listVisitorProgramDetail = (query?: VisitorProgramDetailQuery): AxiosPromise<VisitorProgramDetailVO[]> => {
  return request({
    url: '/order/visitorProgramDetail/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询访客计划明细详细
 * @param id
 */
export const getVisitorProgramDetail = (id: string | number): AxiosPromise<VisitorProgramDetailVO> => {
  return request({
    url: '/order/visitorProgramDetail/' + id,
    method: 'get'
  });
};

/**
 * 新增访客计划明细
 * @param data
 */
export const addVisitorProgramDetail = (data: VisitorProgramDetailForm) => {
  return request({
    url: '/order/visitorProgramDetail',
    method: 'post',
    data: data
  });
};

/**
 * 修改访客计划明细
 * @param data
 */
export const updateVisitorProgramDetail = (data: VisitorProgramDetailForm) => {
  return request({
    url: '/order/visitorProgramDetail',
    method: 'put',
    data: data
  });
};

/**
 * 删除访客计划明细
 * @param id
 */
export const delVisitorProgramDetail = (id: string | number | Array<string | number>) => {
  return request({
    url: '/order/visitorProgramDetail/' + id,
    method: 'delete'
  });
};
